﻿using System;
using System.Collections.Generic;
using System.Linq;
//======================================================================
//
//        Copyright (C) 2015   
//        All rights reserved
//
//        filename : OrderBookDetailedRpt
//        description : 卡片订货管理台账

//        created by XXX at  20150821
//
//======================================================================
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CardLogistics.Web.Components;
using System.Text;
using System.Text.RegularExpressions;

namespace CardLogistics.Web.MainPage.Ordering.Ordering_Cardinfo
{
    public partial class OrderBookDetailedRpt : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             BindRpt();
        }

        private void BindRpt()
        {
            string billNo = Request.QueryString["billNo"];//需求编号
            string conNo = Request.QueryString["conNo"];//合同编号
            string orderNo = Request.QueryString["orderNo"];//订单编号
            string batchNo = Request.QueryString["batchNo"];//批次号

            string strSupNameId = Request.QueryString["SupNameId"];//供应商
            string strCardTypeId = Request.QueryString["CardTypeId"];//卡类型
            string strBtypenameId = Request.QueryString["BtypenameId"];//芯片类型

            StringBuilder sbStr = new StringBuilder();
            sbStr.Append(" SELECT * FROM v_OrderBookDetailed WHERE 1=1  and Issubmit=5 ");

            if (!string.IsNullOrEmpty(billNo) && billNo.Trim().Length > 0)
                sbStr.Append(" and BillNo like '%" + billNo.Trim().ToUpper() + "%' ");//需求编号
            if (!string.IsNullOrEmpty(conNo) && conNo.Trim().Length > 0)
                sbStr.Append(" and conNo like '%" + conNo.Trim().ToUpper() + "%' ");//合同编号
            if (!string.IsNullOrEmpty(orderNo) && orderNo.Trim().Length > 0)
                sbStr.Append(" and orderNo like '%" + orderNo.Trim().ToUpper() + "%' ");//订单编号
            if (!string.IsNullOrEmpty(batchNo) && batchNo.Trim().Length > 0)
                sbStr.Append(" and batchNo like '%" + batchNo.Trim().ToUpper() + "%' ");//批次号

            if (!string.IsNullOrEmpty(strSupNameId) && strSupNameId.Trim().Length > 0 && strSupNameId.Trim()!="0")
                sbStr.Append(" and suppid='" + strSupNameId.Trim().ToUpper() + "' ");//供应商

            if (!string.IsNullOrEmpty(strCardTypeId) && strCardTypeId.Trim().Length > 0 && strCardTypeId.Trim()!="0")
                sbStr.Append(" and CardTypeId='" + strCardTypeId.Trim().ToUpper() + "' ");//卡类型

            if (!string.IsNullOrEmpty(strBtypenameId) && strBtypenameId.Trim().Length > 0 && strBtypenameId.Trim()!="0")
                sbStr.Append(" and basictypeid='" + strBtypenameId.Trim().ToUpper() + "' ");//芯片类型

            sbStr.Append(" order by ORDERDATA");
            OracleXMLReportData.GenNodeXmlData(this, sbStr.ToString(), true);
        }
        
    }
}